<template>
  <div>
    <div class="header">
      <div class="left"></div>
      <div class="serch">
        <p>上海</p>
        <input type="text" placeholder="请输入小区或者地址" />
      </div>
      <div class="right"></div>
    </div>
    <div class="filter-title">
      <p>区域</p>
      <p>方式</p>
      <p>租金</p>
      <p>筛选</p>
    </div>
    <div class="contect" v-for="(item, index) in list" :key="index">
      <div class="pic"><img :src="item.houseImg" alt="" /></div>
      <div class="txt">
        <h3>{{ item.title }}</h3>
        <div class="info">{{ item.desc }}</div>
        <span>{{ item.tags[0] }}</span>
        <div class="price">{{ item.price }}元/月</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'DemoFind',

  data() {
    return {
      list:[]
    }
  },

  mounted() {},
  created() {
    this.getlist()
  },

  methods: {
    async getlist() {
      try {
        const result = await this.$http.get('http://liufusong.top:8080/houses',{
          cityId:'上海',
          stat:1,
          end:10
        })
        console.log(result);
        this.list = result.body.list
      }catch(e){
        console.log(e);
      }
    }
  },
}
</script>

<style lang="less" scoped>
html {
  padding: 0;
  margin: 0;
}
.header {
  width: 100%;
  height: 50px;
  padding: 0 6px 0 8px;
  background-color: #21b97a;
  display: flex;
  align-items: center;
  .left {
    width: 16px;
    height: 16px;
    background-color: red;
  }
  .right {
    width: 25px;
    height: 25px;
    background-color: red;
  }
  .serch {
    flex: 1;
    height: 30px;
    margin: 0 10px;
    padding: 5px 5px 5px 8px;
    border-radius: 3px;
    background-color: #fff;
    border: none;
    display: flex;
    align-items: center;
    p {
      &::after {
        content: "|";
        padding: 0 2px 0 12px;
        color: #9c9fa1;
        font-size: 15px;
        margin-right: 20px;
      }
    }
    input {
      flex: 1;
      height: 30px;
      padding-top: 5px;
      border-radius: 3px;
      border: none;
      position: relative;
      &::before {
        content: "|";
        height: 25px;
        width: 25px;
        padding: 0 2px 0 12px;
        color: #9c9fa1;
        font-size: 15px;
      }
    }
  }
}
.tag {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 50px;
    line-height: 50px;
    text-align: center;
    display: flex;
    background: #fff;
    border-top: 1px solid #e4e4e4;
    a {
      flex: 1;
      text-decoration: none;
      font-size: 14px;
      color: #333;
      -webkit-tap-highlight-color: transparent;
      &.router-link-active {
        color: #fa0;
      }
    }
  }
.contect {
  height: 120px;
  border-bottom: 1px solid #e4e6f0;
  display: flex;
  align-items: center;
  .pic {
    width: 106px;
    height: 80px;
    background-color: skyblue;
    margin-right: 15px;
  }
  .txt {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    h3 {
      font-size: 15px;
      color: #394043;
      margin: 0 5px;
      overflow: hidden;
    }
    .info {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      vertical-align: middle;
      font-size: 12px;
      color: #afb2b3;
      margin: 5px 0;
    }
    span {
      display: inline-block;
      font-size: 12px;
      border-radius: 3px;
      padding: 4px 5px;
      width: 60px;
      margin-right: 5px;
      line-height: 12px;
      background-color: #21b97a;
    }
    .price {
      margin-top: 5px;
      font-size: 12px;
      color: #fa5741;
    }
  }
}
</style>